# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        
        # Adding model 'Product'
        db.create_table('shop_product', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('code', self.gf('django.db.models.fields.CharField')(max_length=250)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=250)),
            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
            ('purchase_price', self.gf('django.db.models.fields.FloatField')()),
            ('price', self.gf('django.db.models.fields.FloatField')()),
        ))
        db.send_create_signal('shop', ['Product'])

        # Adding model 'MovementOfGoods'
        db.create_table('shop_movementofgoods', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('kol', self.gf('django.db.models.fields.IntegerField')(default=0)),
            ('sum', self.gf('django.db.models.fields.FloatField')()),
            ('product', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shop.Product'])),
            ('receiptofgoods', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shop.ReceiptOfGoods'])),
        ))
        db.send_create_signal('shop', ['MovementOfGoods'])

        # Adding model 'ReceiptOfGoods'
        db.create_table('shop_receiptofgoods', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('datetime', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2012, 3, 12, 12, 50, 23, 674675))),
        ))
        db.send_create_signal('shop', ['ReceiptOfGoods'])


    def backwards(self, orm):
        
        # Deleting model 'Product'
        db.delete_table('shop_product')

        # Deleting model 'MovementOfGoods'
        db.delete_table('shop_movementofgoods')

        # Deleting model 'ReceiptOfGoods'
        db.delete_table('shop_receiptofgoods')


    models = {
        'shop.movementofgoods': {
            'Meta': {'object_name': 'MovementOfGoods'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'kol': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'product': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shop.Product']"}),
            'receiptofgoods': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shop.ReceiptOfGoods']"}),
            'sum': ('django.db.models.fields.FloatField', [], {})
        },
        'shop.product': {
            'Meta': {'object_name': 'Product'},
            'code': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
            'price': ('django.db.models.fields.FloatField', [], {}),
            'purchase_price': ('django.db.models.fields.FloatField', [], {})
        },
        'shop.receiptofgoods': {
            'Meta': {'object_name': 'ReceiptOfGoods'},
            'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 3, 12, 12, 50, 23, 674675)'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
        }
    }

    complete_apps = ['shop']
